/** 
  国际学术会议目录
*/
<template>
    <div>
        <condition-card @reset="reset" @search="onSubmit" label-width="150px">
            <el-form>
                <el-row :gutter="24" style="height: 50px;">
                    <el-col :span="8">
                        <!-- 会议级别 -->
                        <el-form-item :label="$t('conOfIntAcaCon.conferenceLevel')">
                            <el-select
                                v-model.trim="queryForm.condition.conferenceLevel"
                                clearable
                                style="width: 100%"
                            >
                                <el-option
                                    v-for="item in options.conferenceLevel"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <!-- 学院 -->
                    <el-col :span="8">
                        <el-form-item :label="$t('conOfIntAcaCon.faculty')">
                            <el-select
                                v-model.trim="queryForm.condition.faculty"
                                clearable
                                filterable
                                style="width: 100%"
                            >
                                <el-option
                                    v-for="item in options.faculty"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <!-- 版本号 -->
                    <el-col :span="8">
                        <el-form-item :label="$t('base.versionCode')">
                            <el-date-picker
                                v-model="queryForm.condition.versionCode"
                                type="month"
                                clearable
                                :placeholder="$t('base.choice')"
                                style="width: 100%"
                                format="yyyyMM"
                                value-format="yyyyMM"
                            ></el-date-picker>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
            <!-- 搜索框结束 -->

            <!-- 列表页开始 -->
        </condition-card>
        <el-card shadow="never" v-loading="loading" body-style="padding: 24px;">
            <h1 class="condition-title">{{ $t('conOfIntAcaCon.ListOfInterAcaConfer') }}</h1>
            <div class="sub-title">
                <div class="float-left">
                    <!-- 搜索框 中/英文名称 -->
                    <el-input
                        v-model.trim="queryForm.condition.name"
                        :placeholder="$t('conOfIntAcaCon.conditionName')"
                        style="width:250px"
                        @keyup.enter.native="onSubmit"
                    >
                        <i
                            slot="suffix"
                            class="el-icon-search"
                            style="margin-top:10px;cursor:pointer"
                            @click="onSubmit"
                        ></i>
                    </el-input>
                </div>
                <div class="float-right" style="display: flex;">
                    <!-- 导入 -->
                    <el-button type="primary" @click="importBtn()">
                        {{ $t('base.importBtn') }}
                    </el-button>
                    <!-- 导出 -->
                    <el-button type="primary" @click="exportMenu()">
                        {{ $t('base.exportMenu') }}
                    </el-button>
                    <!-- 新增 -->
                    <el-button type="primary" @click="addMenu()">
                        {{ $t('base.addMenu') }}
                    </el-button>
                    <!-- 删除 -->
                    <el-button type="danger" @click="deleteMenu()">
                        {{ $t('base.deleteMenu') }}
                    </el-button>
                </div>
            </div>
            <edu-table
                :pagination="false"
                :order="true"
                :tooltipEffect="tooltipEffect"
                stripe
                :data="dataList"
                size="mini"
                @selection-change="handleSelectionChange"
            >
                <!-- 版本号 -->
                <edu-table-column
                    :label="$t('base.versionCode')"
                    prop="versionCode"
                ></edu-table-column>
                <!-- 申请学院 -->
                <edu-table-column
                    :label="$t('conOfIntAcaCon.faculty')"
                    prop="facultyName"
                ></edu-table-column>
                <!-- 一级学科名称 -->
                <edu-table-column
                    :label="$t('base.oneSubjectNameCN')"
                    prop="oneSubjectNameCN"
                    width="160"
                ></edu-table-column>
                <!-- 会议英文名称 -->
                <edu-table-column
                    :label="$t('conOfIntAcaCon.englishName')"
                    prop="englishName"
                    width="160"
                ></edu-table-column>
                <!-- 会议英文名称缩写 -->
                <edu-table-column
                    :label="$t('conOfIntAcaCon.englishNameAbbreviation')"
                    prop="englishNameAbbreviation"
                    width="180"
                ></edu-table-column>
                <!-- 会议中文名称 -->
                <edu-table-column
                    :label="$t('conOfIntAcaCon.name')"
                    prop="name"
                    width="160"
                ></edu-table-column>
                <!-- 会议网址 -->
                <edu-table-column
                    :label="$t('conOfIntAcaCon.conferenceWebsite')"
                    prop="conferenceWebsite"
                ></edu-table-column>
                <!-- 会议级别 -->
                <edu-table-column
                    :label="$t('conOfIntAcaCon.conferenceLevelName')"
                    prop="conferenceLevelName"
                ></edu-table-column>
                <!-- 会议频次 -->
                <edu-table-column
                    :label="$t('conOfIntAcaCon.conferenceFrequency')"
                    prop="conferenceFrequency"
                ></edu-table-column>
                <!-- 备注 -->
                <edu-table-column
                    :label="$t('conOfIntAcaCon.remark')"
                    prop="remark"
                ></edu-table-column>
                <!-- 操作 -->
                <edu-table-column :label="$t('base.operate')" fit width="200">
                    <template slot-scope="scope">
                        <!-- 编辑 -->
                        <el-button type="text" @click="editMenu(scope.row)">
                            {{ $t('base.editMenu') }}
                        </el-button>
                        <!-- 删除 -->
                        <el-button type="text" @click="deleteMenu(scope.row, 'delOne')">
                            {{ $t('base.deleteMenu') }}
                        </el-button>
                    </template>
                </edu-table-column>
            </edu-table>
            <el-row type="flex" class="row-bg" justify="end">
                <el-col>
                    <el-pagination
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                        :current-page="queryForm.pageNum_"
                        :page-sizes="[20, 40, 80, 100]"
                        :page-size="queryForm.pageSize_"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="queryForm.total_"
                        style="float:right;margin-top:10px"
                    ></el-pagination>
                </el-col>
            </el-row>
        </el-card>

        <!-- 新增 编辑 弹窗  开始 -->
        <el-dialog
            :title="ifAddTittle"
            :visible.sync="centerDialogVisible"
            :close-on-click-modal="false"
            :close-on-press-escape="false"
            width="50%"
        >
            <edu-form
                :model="addForm"
                ref="addForm"
                label-width="170px"
                label-position="top"
                :rules="rulesForm"
            >
                <el-row :gutter="20">
                    <el-col :span="10">
                        <!-- 版本号 -->
                        <el-form-item :label="$t('base.versionCode')" prop="versionCode">
                            <el-input
                                v-model="addForm.versionCode"
                                maxlength="32"
                                class="topic-input-select"
                                disabled
                            ></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row :gutter="20">
                    <el-col :span="10">
                        <!-- 会议申报学院 -->
                        <el-form-item :label="$t('conOfIntAcaCon.meetingFaculty')" prop="faculty">
                            <el-select
                                v-model="addForm.faculty"
                                style="width: 100%;"
                                @change="getSubject"
                            >
                                <el-option
                                    v-for="item in options.faculty"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>

                    <el-col :span="10">
                        <!-- 会议级别 -->
                        <el-form-item
                            :label="$t('conOfIntAcaCon.conferenceLevelName')"
                            prop="conferenceLevel"
                        >
                            <el-select v-model="addForm.conferenceLevel" style="width: 100%;">
                                <el-option
                                    v-for="item in options.conferenceLevel"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row :gutter="20">
                    <el-col :span="10">
                        <!-- 一级学科名称 -->
                        <el-form-item :label="$t('base.oneSubjectNameCN')" prop="oneSubjectName">
                            <el-select v-model="addForm.oneSubjectName" style="width: 100%;">
                                <el-option
                                    v-for="item in options.oneSubjectName"
                                    :key="item.code"
                                    :label="item.name"
                                    :value="item.code"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <!-- 国际会议英文名称 -->
                        <el-form-item :label="$t('conOfIntAcaCon.englishName')" prop="englishName">
                            <el-input
                                v-model="addForm.englishName"
                                maxlength="128"
                                class="topic-input-select"
                                :placeholder="$t('base.inputPla')"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row :gutter="20">
                    <el-col :span="10">
                        <!-- 国际会议中文名称 -->
                        <el-form-item :label="$t('conOfIntAcaCon.name')" prop="name">
                            <el-input
                                v-model="addForm.name"
                                maxlength="32"
                                class="topic-input-select"
                                :placeholder="$t('base.inputPla')"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <!-- 国际会议英文名称缩写 -->
                        <el-form-item
                            :label="$t('conOfIntAcaCon.englishNameAbbreviationM')"
                            prop="englishNameAbbreviation"
                        >
                            <el-input
                                v-model="addForm.englishNameAbbreviation"
                                maxlength="32"
                                class="topic-input-select"
                                :placeholder="$t('base.inputPla')"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row :gutter="20">
                    <el-col :span="10">
                        <!-- 国际会议网址 -->
                        <el-form-item
                            :label="$t('conOfIntAcaCon.conferenceWebsite')"
                            prop="conferenceWebsite"
                        >
                            <el-input
                                v-model="addForm.conferenceWebsite"
                                maxlength="320"
                                class="topic-input-select"
                                :placeholder="$t('base.inputPla')"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <!-- 会议频次 -->
                        <el-form-item
                            :label="$t('conOfIntAcaCon.conferenceFrequency')"
                            prop="conferenceFrequency"
                        >
                            <el-input
                                v-model="addForm.conferenceFrequency"
                                maxlength="32"
                                class="topic-input-select"
                                :placeholder="$t('base.inputPla')"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row :gutter="20">
                    <el-col :span="20">
                        <!-- 备注 -->
                        <el-form-item :label="$t('conOfIntAcaCon.remark')" prop="remark">
                            <el-input
                                v-model="addForm.remark"
                                class="topic-input-select"
                                type="textarea"
                                :rows="4"
                                maxlength="500"
                                show-word-limit
                                :placeholder="$t('base.inputPla')"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-form-item>
                    <el-row :gutter="20" style="text-align: right;margin-right:20px;">
                        <el-button type="default" @click="closeCon">
                            {{ $t('schoolCourseTimeSet.cancel') }}
                        </el-button>
                        <el-button type="primary" @click="submit">
                            {{ $t('base.onsubmit') }}
                        </el-button>
                    </el-row>
                </el-form-item>
            </edu-form>
        </el-dialog>
        <!-- 新增 编辑 弹窗  结束 -->

        <!-- 导入 开始 -->
        <el-dialog
            :title="$t('conOfIntAcaCon.exportTiTle')"
            :visible.sync="importConference"
            :close-on-click-modal="false"
            :close-on-press-escape="false"
            width="570px"
        >
            <div style="width:100%;text-align:center; margin-left:110px">
                <el-form
                    label-position="left"
                    :rules="importRules"
                    ref="exportForm"
                    :model="exportForm"
                >
                    <el-row :gutter="18">
                        <el-col :span="18">
                            <el-form-item
                                :label="$t('base.versionCode')"
                                label-width="70px"
                                prop="versionCode"
                            >
                                <el-date-picker
                                    v-model="exportForm.versionCode"
                                    type="month"
                                    :placeholder="$t('base.choice')"
                                    format="yyyyMM"
                                    value-format="yyyyMM"
                                    style="width: 180px"
                                    :picker-options="pickerOptions"
                                    @change="ifUpload"
                                ></el-date-picker>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row :gutter="18">
                        <el-col :span="6">
                            <!-- 下载模板 -->
                            <el-form-item>
                                <el-button type="primary" @click="downLoad" style="margin-top:20px">
                                    {{ $t('conOfIntAcaCon.downLoadModel') }}
                                </el-button>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
                            <el-form-item>
                                <div style="margin-top:20px;  width:100%">
                                    <el-upload
                                        ref="upload"
                                        v-model="dialogForm.file"
                                        class="upload-demo"
                                        :disabled="ifVersionCode"
                                        :action="uploadUrl"
                                        :data="uploadConfig.data"
                                        :before-upload="beforeUpload"
                                        :on-success="handlerUploadSuccess"
                                        :before-remove="handlerBeforeRemove"
                                        :on-remove="handlerRemove"
                                        :on-error="handlerUploadError"
                                        multiple
                                        :limit="1"
                                        :file-list="uploadConfig.fileList"
                                    >
                                        <el-button
                                            size="small"
                                            type="primary"
                                            :disabled="ifVersionCode"
                                        >
                                            {{ $t('conOfIntAcaCon.uploadCon') }}
                                        </el-button>
                                        <!-- 请上传xls、xlsx文件 -->
                                        <div slot="tip" class="el-upload__tip">
                                            {{ $t('conOfIntAcaCon.uploadNotice') }}
                                        </div>
                                    </el-upload>
                                </div>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
                            <!-- 重置上传 -->
                            <el-form-item>
                                <el-button
                                    type="primary"
                                    @click="resetUpload"
                                    style="margin-top:20px"
                                >
                                    {{ $t('conOfIntAcaCon.restUpload') }}
                                </el-button>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </el-form>
            </div>
            <el-table stripe :data="errList" size="mini" v-show="ifErr" tooltip-effect="light">
                <!-- 学院 -->
                <el-table-column
                    :label="$t('conOfIntAcaCon.faculty')"
                    prop="faculty"
                    width="50px"
                    show-overflow-tooltip
                ></el-table-column>
                <!-- 一级学科名称 -->
                <el-table-column
                    :label="$t('base.oneSubjectNameCN')"
                    prop="oneSubjectName"
                    width="120px"
                    show-overflow-tooltip
                ></el-table-column>
                <!-- 会议英文名称 -->
                <el-table-column
                    :label="$t('conOfIntAcaCon.englishName')"
                    prop="englishName"
                    width="120px"
                    show-overflow-tooltip
                ></el-table-column>
                <!-- 会议级别 -->
                <el-table-column
                    :label="$t('conOfIntAcaCon.englishName')"
                    prop="conferenceLevel"
                    width="100px"
                    show-overflow-tooltip
                ></el-table-column>
                <!-- 原因 -->
                <el-table-column
                    :label="$t('conOfIntAcaCon.reason')"
                    prop="reason"
                    width="120px"
                    show-overflow-tooltip
                ></el-table-column>
            </el-table>
        </el-dialog>
        <!-- 导入  结束 -->

        <edu-export-dialog :title="$t('message.prompt')" ref="downloadRef"></edu-export-dialog>
    </div>
</template>
<script>
import conOfIntAcaConApi from 'common/src/api/internationalCommunication/conOfIntAcaCon'
import { queryDic } from 'common/src/api/dictionary'
import baseUrl from 'common/src/api/internationalCommunication/env'
import UTILS from 'common/src/utils/utils'
export default {
    data() {
        return {
            ifAddTittle: '', // 新增、编辑弹窗 页面名称
            maxCode: '', // 当前版本号
            submitType: '', // 提交类型  add：新增  edit：编辑
            ifVersionCode: true, // 是否允许上传
            ifErr: false, // 是否展示错误信息
            centerDialogVisible: false, // 是否显示新增、编辑弹框
            importConference: false, // 是否显示导入框
            uploadUrl: `${baseUrl}/pgIntlConference/importConference`,
            queryForm: {
                pageNum_: 1,
                pageSize_: 20,
                total_: 0,
                condition: {
                    faculty: '',
                    conferenceLevel: '',
                    versionCode: '',
                    name: ''
                }
            },
            // 导入
            exportForm: {
                versionCode: ''
            },
            // 导入失败列表
            errList: [],
            addForm: {
                versionCode: '',
                faculty: '',
                oneSubjectName: '',
                englishName: '',
                englishNameAbbreviation: '',
                name: '',
                conferenceWebsite: '',
                conferenceLevel: '',
                conferenceFrequency: '',
                remark: ''
            },
            dataList: [],
            dialogForm: {
                semester: '',
                examinationTime: '',
                file: ''
            },
            uploadConfig: {
                fileList: [],
                data: { versionCode: '' }
            },
            fileFlag: true,
            applyForm: {
                attachFile: [],
                attachName: []
            },
            dialogVisible: false,
            multipleSelection: {
                ids: []
            },
            currentAssessIndex: {},
            options: {
                conferenceLevel: [
                    // 顶级会议
                    { value: 1, label: this.$t('conOfIntAcaCon.topMeeting') },
                    // A类会议
                    { value: 2, label: this.$t('conOfIntAcaCon.AMeeting') },
                    // B类会议
                    { value: 3, label: this.$t('conOfIntAcaCon.BMeeting') }
                ],
                faculty: [],
                oneSubjectName: []
            },
            importRules: {
                versionCode: [
                    {
                        required: true,
                        message: this.$t('base.choice'),
                        trigger: 'change'
                    }
                ]
            },
            rulesForm: {
                faculty: [
                    {
                        required: true,
                        message: this.$t('base.choice'),
                        trigger: 'change'
                    }
                ],
                conferenceLevel: [
                    {
                        required: true,
                        message: this.$t('base.choice'),
                        trigger: 'change'
                    }
                ],
                oneSubjectName: [
                    {
                        required: true,
                        message: this.$t('base.choice'),
                        trigger: 'change'
                    }
                ],
                englishName: [
                    {
                        required: true,
                        message: this.$t('base.inputPla'),
                        trigger: 'blur'
                    }
                ],
                name: [
                    {
                        required: true,
                        message: this.$t('base.inputPla'),
                        trigger: 'blur'
                    }
                ],
                englishNameAbbreviation: [
                    {
                        required: true,
                        message: this.$t('base.inputPla'),
                        trigger: 'blur'
                    }
                ],
                // conferenceWebsite: [
                //     {
                //         required: true,
                //         message: this.$t('base.inputPla'),
                //         trigger: 'blur'
                //     }
                // ],
                conferenceFrequency: [
                    {
                        required: true,
                        message: this.$t('base.inputPla'),
                        trigger: 'blur'
                    }
                ],
                remark: [
                    {
                        required: false,
                        message: this.$t('base.inputPla'),
                        trigger: 'blur'
                    }
                ]
            },
            parentInnerVisible: false
        }
    },
    computed: {
        pickerOptions() {
            let _this = this
            return {
                disabledDate: time => {
                    let nowData = new Date(_this.maxCode.slice(0, 4) + '-' + _this.maxCode.slice(4))
                    nowData = new Date(nowData.setDate(nowData.getDate() - 1))
                    return time < nowData
                }
            }
        }
    },
    created() {
        // 初始化列表页
        this.getListData()
        this.initOptions()
    },
    methods: {
        async initOptions() {
            // 筛选条件字典查询
            let data = {
                lang: this.$store.getters.language || 'cn',
                type: 'allChild',
                keys: [
                    'X_YX' // 学院
                ]
            }
            await queryDic(data).then(res => {
                UTILS.fillSelect(
                    {
                        faculty: 'X_YX' // 学院
                    },
                    res.data,
                    this.options
                )
            })
        },
        // 获取版本号
        getCode() {
            let _this = this
            conOfIntAcaConApi.getVersion().then(res => {
                _this.maxCode = res.data
            })
        },
        // 根据学院获取一级学科名称
        getSubject(val) {
            let _this = this
            if (val) {
                this.options.oneSubjectName = []
                this.addForm.oneSubjectName = ''
                this.$nextTick(() => {
                    this.$refs['addForm'].clearValidate('oneSubjectName')
                })
                let searchParm = {
                    faculty: val,
                    oneSubjectName: ''
                }
                conOfIntAcaConApi.getOneSubject(searchParm).then(res => {
                    if (res.data) {
                        res.data.forEach(subjectList => {
                            _this.options.oneSubjectName.push(subjectList)
                        })
                    }
                })
            }
        },
        // 新增按钮 打开新增弹窗
        addMenu() {
            this.submitType = 'add'
            this.centerDialogVisible = true
            // 国际学术会议目录 - 新增
            this.ifAddTittle = this.$t('conOfIntAcaCon.addTitle')
            this.addForm = {
                versionCode: '',
                faculty: '',
                oneSubjectName: '',
                englishName: '',
                englishNameAbbreviation: '',
                name: '',
                conferenceWebsite: '',
                conferenceLevel: '',
                conferenceFrequency: '',
                remark: ''
            }
            this.$nextTick(() => {
                this.$refs['addForm'].clearValidate()
            })
            conOfIntAcaConApi.getVersion().then(res => {
                this.addForm.versionCode = res.data
            })
        },
        // 修改按钮 打开修改弹窗
        editMenu(row) {
            this.submitType = 'edit'
            this.centerDialogVisible = true
            // 国际学术会议目录 - 编辑
            this.ifAddTittle = this.$t('conOfIntAcaCon.editTitle')
            this.$nextTick(() => {
                this.$refs['addForm'].clearValidate()
            })
            for (let key in this.addForm) {
                this.addForm[key] = row[key]
            }
            this.addForm.id = row.id
            this.getSubject(row.faculty)
            this.addForm.oneSubjectName = row.oneSubjectName
        },
        closeCon() {
            // 是否确认取消并关闭？
            this.$confirm(this.$t('base.makeSure'), '提示', {
                // 确定
                confirmButtonText: this.$t('base.sure'),
                // 取消
                cancelButtonText: this.$t('base.cancel'),
                type: 'warning'
            })
                .then(() => {
                    this.centerDialogVisible = false
                    this.getListData()
                })
                .catch(() => {})
        },
        // 重置上传
        resetUpload() {
            this.exportForm.versionCode = ''
            this.uploadConfig.fileList = []
            this.ifVersionCode = true
            this.errList = []
            this.ifErr = false
        },
        // 打开导入目录 弹窗
        importBtn() {
            this.importConference = true
            this.resetUpload()
            this.$nextTick(() => {
                this.$refs['exportForm'].clearValidate()
            })
            // conOfIntAcaConApi.getVersion().then(res => {
            //     this.maxCode = res.data
            // })
        },

        // 导出目录
        exportMenu() {
            let _this = this
            let parm = {
                conferenceLevel: this.queryForm.condition.conferenceLevel,
                faculty: this.queryForm.condition.faculty,
                versionCode: this.queryForm.condition.versionCode,
                name: this.queryForm.condition.name,
                ids: this.multipleSelection.ids
            }
            if (_this.dataList.length === 0) {
                _this.$message.error('无数据')
            } else {
                this.$refs.downloadRef.open()
                conOfIntAcaConApi
                    .exportExcelF(parm)
                    .then(res => {
                        if (res.data && res.data.key) {
                            conOfIntAcaConApi.exportExcelS(res.data.key).then(resS => {
                                if (resS.data && resS.data.path) {
                                    conOfIntAcaConApi.exportExcelT(resS.data.path).then(resT => {
                                        _this.$message({
                                            message: _this.$t('base.exportSuccess'),
                                            type: 'success'
                                        })
                                        this.$refs.downloadRef.close()
                                    })
                                } else {
                                    _this.exportNext(res.data.key)
                                }
                            })
                        }
                    })
                    .catch(err => {
                        this.$refs.downloadRef.close()
                    })
            }
        },
        // 导出轮询
        exportNext(val) {
            let _this = this
            setTimeout(() => {
                conOfIntAcaConApi.exportExcelS(val).then(resS => {
                    if (resS.data && resS.data.path) {
                        conOfIntAcaConApi.exportExcelT(resS.data.path).then(resT => {
                            _this.$message({
                                message: _this.$t('base.exportSuccess'),
                                type: 'success'
                            })
                            this.$refs.downloadRef.close()
                        })
                    } else {
                        _this.exportNext(val)
                    }
                })
            }, 3000)
        },
        // 删除目录
        deleteMenu(row, delType) {
            let _this = this
            if (this.multipleSelection.ids.length === 0 && delType !== 'delOne') {
                this.$message.error('请勾选数据')
            } else if (delType === 'delOne') {
                let parm = {
                    ids: [row.id]
                }
                this.$delConfirm().then(_ => {
                    conOfIntAcaConApi.deleteConference(parm).then(res => {
                        if (res.code === 200) {
                            _this.$message({
                                // 删除成功
                                message: _this.$t('base.delSuccess'),
                                type: 'success'
                            })
                            _this.getListData()
                        }
                    })
                })
            } else {
                this.$delConfirm().then(_ => {
                    conOfIntAcaConApi.deleteConference(_this.multipleSelection).then(res => {
                        if (res.code === 200) {
                            _this.$message({
                                // 删除成功
                                message: _this.$t('base.delSuccess'),
                                type: 'success'
                            })
                            _this.getListData()
                        }
                    })
                })
            }
        },

        // 重置筛选框
        reset() {
            this.queryForm = {
                pageNum_: 1,
                pageSize_: 20,
                total_: 0,
                condition: {
                    faculty: '',
                    versionCode: '',
                    name: '',
                    conferenceLevel: ''
                }
            }
            this.getListData()
        },

        // 查询按钮
        onSubmit() {
            this.queryForm.pageNum_ = 1
            this.queryForm.total_ = 0
            this.queryForm.pageSize_ = 20
            this.getListData()
        },

        // 获取列表
        getListData() {
            let _this = this
            this.dataList = []
            conOfIntAcaConApi.getConferenceList(this.queryForm).then(res => {
                res.data.list.forEach(revList => {
                    _this.dataList.push(revList)
                    _this.queryForm.pageSize_ = res.data.pageSize_
                    _this.queryForm.total_ = res.data.total_
                    _this.queryForm.pageNum_ = res.data.pageNum_
                })
                _this.getCode()
                _this.multipleSelection.ids = []
            })
        },
        handleSelectionChange(val) {
            this.multipleSelection.ids = []
            val.forEach(menu => {
                this.multipleSelection.ids.push(menu.id)
            })
        },
        handleSizeChange(val) {
            this.queryForm.pageSize_ = val
            this.getListData()
        },
        handleCurrentChange(val) {
            this.queryForm.pageNum_ = val
            this.getListData()
        },
        downLoadEnclosureFile(url) {
            downloadfile(url)
        },
        beforeUpload(file) {
            const fileSizeFlag = file.size && file.size / 1024 / 1024 < 10
            let fileType = file.name.substring(file.name.lastIndexOf('.') + 1)
            const uploadFlag = fileType === 'xls' || fileType === 'xlsx'
            if (!this.exportForm.versionCode) {
                // 请选择版本号
                this.$message.error(_this.$t('conOfIntAcaCon.notice'))
                return false
            } else {
                this.uploadConfig.data.versionCode = this.exportForm.versionCode
            }
            if (!uploadFlag) {
                window.vueApp.showMsgBox({
                    message: this.$t('minor.approve.uploadFileError'),
                    callback: () => {}
                })
            }
            if (!fileSizeFlag) {
                window.vueApp.showMsgBox({
                    message: this.$t('minor.approve.uploadSizeError'),
                    callback: () => {}
                })
            }
            this.fileFlag = uploadFlag && fileSizeFlag
            if (!(uploadFlag && fileSizeFlag)) {
                return false
            }
        },
        handlerUploadSuccess(response, file, fileList) {
            this.errList = []
            let responseCode = response.code
            let _this = this
            if (responseCode === 200) {
                // 导入成功
                _this.$message({
                    message: _this.$t('base.importSuccess'),
                    type: 'success'
                })
                // 展示导入错误 的信息
                if (response.data) {
                    _this.ifErr = true
                    response.data.forEach(err => {
                        _this.errList.push(err)
                    })
                }
            } else if (response.msg) {
                _this.$message.error(response.msg)
            }
            this.getListData()
        },
        handlerBeforeRemove(file, fileList) {
            if (this.fileFlag) {
                return this.$delConfirm().then(_ => {})
            }
        },
        handlerRemove(file, fileList) {
            this.errList = []
            this.ifErr = false
            let index = this.applyForm.attachFile.indexOf(file.url)
            this.applyForm.attachFile.splice(index, 1)
            this.applyForm.attachName.splice(index, 1)
        },
        handlerUploadError(response, file, fileList) {
            this.$message({
                message: this.$t('graduateBase.uploadFail'),
                type: 'error'
            })
        },
        // 判断是否选择了版本号  选择了则允许上传目录
        ifUpload(val) {
            if (val) {
                this.ifVersionCode = false
            } else {
                this.ifVersionCode = true
            }
        },

        // 新增提交
        submit() {
            let _this = this
            this.$refs['addForm'].validate(valid => {
                if (valid) {
                    if (_this.submitType === 'add') {
                        conOfIntAcaConApi.addConference(this.addForm).then(res => {
                            if (res.code === 200) {
                                // 新增成功
                                _this.$message({
                                    message: this.$t('base.addSuccess'),
                                    type: 'success'
                                })
                                _this.centerDialogVisible = false
                                _this.getListData()
                            }
                        })
                    } else if (_this.submitType === 'edit') {
                        conOfIntAcaConApi.editConference(this.addForm).then(res => {
                            if (res.code === 200) {
                                // 编辑成功
                                _this.$message({
                                    message: this.$t('base.editSuccess'),
                                    type: 'success'
                                })
                                _this.centerDialogVisible = false
                                _this.getListData()
                            }
                        })
                    }
                }
            })
        },
        // 下载导入模板
        downLoad() {
            conOfIntAcaConApi.downloadTemplate().then(res => {})
        }
    }
}
</script>
<style lang="scss" scoped>
.condition-card ::v-deep {
    .el-row {
        height: 30px !important;
    }
    .el-form-item {
        margin-bottom: 0 !important;
    }
}
.roster-container ::v-deep {
    .el-date-editor--datetimerange.el-input__inner {
        width: 100% !important;
    }
    .el-form {
        padding-right: 15px;
    }
}
.condition-title {
    color: #2b3b4e;
    font-size: 18px;
    line-height: 24px;
    font-weight: bold;
}
.sub-title {
    margin: 16px 0 65px 0;
    font-size: 16px;
    color: #000020;
    letter-spacing: 0;
}
.yearSpan {
    margin-left: 50px;
    line-height: 32px;
    min-height: 33px;
    font-size: 14px;
    font-weight: normal;
}
</style>
